/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package algoritmo;

/**
 *
 * @author melvinrafaelvegavega
 */
import org.w3c.dom.*;
import java.io.*;
import org.xml.sax.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;


public class simbolo {
    private String[] cadena;
    public static void main(String[] args)
     {
      simbolo s;
      s=new simbolo();
      String[] x=s.obtSimbolo();
      System.out.println(x[0]);
     }
    private simbolo(){

    }
    public String[] obtSimbolo(){
        
        File file = new File(" file:/Users/melvinrafaelvegavega/NetBeansProjects/algoritmo/src/algoritmo/tabla.xm");
        try {
         DocumentBuilder builder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
         Document doc = builder.parse(file);

         NodeList nodes = doc.getElementsByTagName("datatype");
         cadena=new String[nodes.getLength()];
         for (int i = 0; i < nodes.getLength(); i++) {
            Element element = (Element) nodes.item(i);

            cadena[i]=new String(element.getNodeValue());
           }
        }
        catch (Exception e) {
          e.printStackTrace();
        }

        return cadena;
    }

}
